package edu.cmu.ibill.databeans;

import java.sql.Date;

/**
 * Bean Class for personal bill table.
 * 
 * @author Yunkai Zhang
 * 
 */
public class PersonalBill {

	private int id = -1;
	private int userId;
	private double amount;
	private String description;
	private Date date;
	private int categoryId;
	private boolean isShared = false;

	/**
	 *  Constructor
	 */
	public PersonalBill() {
		;
	}

	/**
	 *  Constructor
	 * @param id
	 */
	public PersonalBill(int id) {
		this.id = id;
	}
	
	/**
	 *  Set personal bill id
	 * @param id
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 *  Set the  user id
	 * @param userid
	 */
	public void setUserId(int uid) {
		this.userId = uid;
	}


	/**
	 *  Set the amonut of this bill
	 * @param amount
	 */
	public void setAmount(double a) {
		this.amount = a;
	}

	/**
	 *  Set the description
	 * @param description
	 */
	public void setDescription(String d) {
		this.description = d;
	}

	/**
	 * Set Date of the bill
	 * @param date
	 */
	public void setDate(Date date) {
		this.date = date;
	}
	
	/**
	 * Set the Category ID
	 * @param category id
	 */
	public void setCategoryId(int cid){
		this.categoryId = cid;
	}
	
	public void setIsShared(boolean iS){
		this.isShared = iS;
	}

	/**
	 * Get the Personal Bill id
	 * @return id
	 */
	public int getId() {
		return id;
	}


	/**
	 * Get the user id
	 * @return userid
	 */
	public int getUserId() {
		return this.userId;
	}


	/**
	 * Get the description of this personal bill
	 * @return description
	 */
	public String getDescription() {
		return this.description;
	}

	/**
	 * Get the date
	 * @return date
	 */
	public Date getDate() {
		return date;
	}

	/**
	 * Get the total amount of the bill
	 * @return amount
	 */
	public double getAmount() {
		return amount;
	}
	
	/**
	 * Get the category id of this bill
	 * @return
	 */
	public int getCategoryId(){
		return this.categoryId;
	}
	
	/**
	 * Get the boolean feature, which indicates this bill is shared or not
	 * @return
	 */
	public boolean getIsShared(){
		return this.isShared;
	}
	
	/**
	 * If the bill is shared, return true.
	 * @return
	 */
	public boolean isShared(){
		return this.isShared;
	}

}
